<%--
@Created by IntelliJ IDEA
@Project_Name ieco_server
@Package 
@Author ZhongYao_H
@Date 2019/5/2:13:00
@Year 2019 Month 05 Day 02
@Date_zh  2019年 五月 星期四
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>申请机构</title>
    <%@include file="/WEB-INF/common/hplus-css.jsp" %>
    <%@include file="/WEB-INF/common/hplus-js.jsp" %>
</head>
<body>
<form action="${path}/organ/add" class="form-horizontal m-t" id="menuForm" method="post">
    <div class="form-group">
        <label class="col-sm-3 control-label"></label>
        <div class="col-sm-8">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"></label>
        <div class="col-sm-8">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"></label>
        <div class="col-sm-8">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">机构名称：</label>
        <div class="col-sm-1 ">
            <input type="hidden" name='id' value='${org.id}'/>
            <span class="span">${org.name}</span>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">机构类型：</label>
        <div class="col-sm-8">
            <span class="span text-center">
                <c:if test="${org.type=='1'}">
                    幼儿园
                </c:if>
                <c:if test="${org.type=='2'}">
                    小学
                </c:if>
                <c:if test="${org.type=='3'}">
                    初中
                </c:if>
                <c:if test="${org.type=='4'}">
                    高中
                </c:if>
                <c:if test="${org.type=='5'}">
                    大学
                </c:if>
                <c:if test="${org.type=='6'}">
                    国企
                </c:if>
                <c:if test="${org.type=='7'}">
                    民企
                </c:if>
                <c:if test="${org.type=='8'}">
                    外企
                </c:if>
                <c:if test="${org.type=='9'}">
                    政府
                </c:if>
                <c:if test="${org.type=='10'}">
                    公益
                </c:if>
                <c:if test="${org.type=='11'}">
                    社团
                </c:if>

            </span>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">机构地址：</label>
        <div class="col-sm-8">
            <span class="span">${org.address}</span>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">机构人数：</label>
        <div class="col-sm-8">
            <span class="span">${org.number}</span>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">机构管理：</label>
        <div class="col-sm-8">
            <span class="span">${org.adminName}</span>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label">管理电话：</label>
        <div class="col-sm-8">
            <span class="span">${org.administratorTel}</span>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label">机构财务：</label>
        <div class="col-sm-8">
            <span class="span">${org.financial}</span>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label">财务电话：</label>
        <div class="col-sm-8">

            <span class="span">${org.number}</span>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label">发票抬头：</label>
        <div class="col-sm-8">
            <c:if test="${org.invoice != ''}">
                <span class="span span21 span-A span-B">${org.invoice}</span>
            </c:if>
            <c:if test="${org.invoice == ''}">
                <span class="span span21 span-A span-B">不开发票</span>
            </c:if>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label">发票税号：</label>
        <div class="col-sm-8">
            <c:if test="${org.ein != ''}">
                <span class="span span21 span-A span-B">${org.ein}</span>
            </c:if>
            <c:if test="${org.ein == ''}">
                <span class="span span21 span-A span-B">不开发票</span>
            </c:if>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">处理意见：</label>
        <div class="col-sm-8">
            <input name="msg" class="form-control" maxlength="60" id="msg"/>
        </div>
    </div>


    <div class="form-group">
        <div class="col-sm-4 col-sm-offset-3" style="text-align:center">
            <button class="btn btn-primary" onclick="audit(2)"  type="button">通过</button>

            <button class="btn btn-danger" onclick="audit(3)" style="margin-left: 10%" type="button">驳回</button>
        </div>
    </div>
</form>
<script type="text/javascript">

    $(document).read(function () {


    });


    function audit(audit) {

        if ($("#msg").val()==''){
            layer.msg("请填写处理意见",{icon:5});
            return ;
        }

        $.ajax({
            url:'${path}/organ/audit',
            data:{'id':'${org.id}','audit':audit,'msg':$('#msg').val()},
            method:'POST',
            dataType:'json',
            success:function (json) {
                var code = json.code;
                if (code==0){
                    layer.msg(json.msg,{icon:1});
                    setTimeout(function () {
                        parent.window.location.reload();
                        parent.layer.closeAll();
                    },1000)
                }else {
                    layer.msg(json.msg,{icon:5});
                }
            },
            error:function () {

            }


        });


    }



</script>
</body>
</html>
